package util;

/*#limit                      偏移量：从几开始   ，  数量：每页显示多少
    select *from sts limit  0,10
            1   0*10
            2   1*10

            100  (100-1)*10

           偏移量公式 (currentPage-1)*pageSize
 */
public class Page {
//# totalCount总行数  查询记录数
    private int totalCount;
    private int totalPage;//总页数
  //          #pageSize每页显示多少数据      今天写 固定值
    private int pageSize=10;//可以固定写死
    private int currentPage;//当前页码
    // 当前页的数据   T  泛型
   // List<T> list=new ArrayList<T>(0);
    //alt+insert

    public int getCurrentPage() {
        return currentPage;
    }
    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }
    public int getTotalCount() {
        return totalCount;
    }
    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
    }
    public int getTotalPage() {
        return totalPage;
    }
    public void setTotalPage() {
        this.totalPage = totalCount%pageSize==0?totalCount/pageSize:totalCount/pageSize+1;
        //#totalPage总页数  考虑到是否能整除   总行数%pageSize==0?总行数/pageSize:  总行数/pageSize+1
    }
    public int getPageSize() {
        return pageSize;
    }
    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }
}
